import { Form } from '@ant-design/compatible';
import AuthComponent from '@/components/Authorized/AuthComponent';
import '@ant-design/compatible/assets/index.css';
import { DatePicker, message, Input, Select, Button, notification, Modal } from 'antd';
import router from 'umi/router'
import React, { useState, useCallback, useRef, useEffect } from 'react';
import ProTable from '@ant-design/pro-table';
import { useRequest, useInViewport } from '@umijs/hooks';
import { connect } from 'dva';
import { getVipRoom, queryCityInfo, vipBoardNotice, getlistVIPEntryPage, statisticPeople, roomBindUser, getPaxType, downloadVipEntryPage } from './service';
import moment from 'moment';
import { useActivate } from 'react-activation';
import styles from './index.less';
import { formatFlightNo, controlTableHeight } from '@/utils/pagesGeneralMethods'; // 页面通用方法
// 页面自定义组件
// import Endorse from './components/endorse'; //旅客改签 
import AddEntourage from './components/addEntourage'; //随行人员添加
import VipFarewellOrCancel from './components/vipFarewellOrCancel'; //送别或撤销
import SMSNotice from './components/smsNotice'; //短信通知
import EditPassenger from './components/editPassenger'; //编辑
import VipGreet from './components/vipGreet'; //迎接

const { Option } = Select;
const { confirm } = Modal;
const VipAccess = (props) => {
  const { data: paxTypeData } = useRequest(getPaxType,{loadingDelay: true}); //获取旅客类别
  const { data: selectData } = useRequest(queryCityInfo,{loadingDelay: true}); //获取出发和到达航站
  const { run:getVipRoomDataFun,data: vipRoomData } = useRequest(()=>{return getVipRoom()},{loadingDelay: true}); //获取贵宾室数据
  const [selectedRowKeys, setSelectedRowKeys] = useState([])// 选中项的id

  const { run: roomBindUserFun } = useRequest(params => roomBindUser(params), {
    manual: true,
    onSuccess: data => {
      message.success(logiUserVipId ? '绑定贵宾室成功' : '解绑成功')
      reloadTable();
    },
  });

  const [isCollapse, controlC] = useState(true); //搜索面板是否折叠
  const [scanCode, setScanCode] = useState(''); //扫描获取的code-用于迎接
  const [scanCodeToEntourage, setScanCodeToEntourage] = useState(''); //扫描获取的code-用于添加随行
  const [openType, setOpenType] = useState('scan'); //迎接区别点击还是扫描
  // const [dataSourceFlag, setDataSourceFlag] = useState('scan'); //添加随行区别查询还是扫描

  const [logiUserVipId, setLogiUserVipId] = useState(null); //当前登录用户绑定的贵宾室id
  const [meetPeoples, setMeetPeoples] = useState(0); //已迎接人数
  const [farewellPeoples, setFarewellPeoples] = useState(0); //已送别人数
  const [dataTotal, setDataTotal] = useState(0); //数据总数
  
  const [exportFlag, handleExportFlag] = useState(false); // 导出数据的标志
  const [searchParams, setSearchParams] = useState(null); //查询参数

  const [vipRoomObj, setVipRoomObj] = useState({})// 选中的贵宾室数据
  const [selectRow, setSelectRow] = useState([])// 选中的旅客
  // const [endorseVisible, setEndorseVisible] = useState(false)// 旅客改签弹框
  const [addEntourageVisible, setAddEntourageVisible] = useState(false)// 添加随行人员弹框
  const [farewellVisible, setFarewellVisible] = useState(false)// 送别或者撤销弹框
  const [smsNoticeVisible, setSmsNoticeVisible] = useState(false)// 短信通知弹框
  const [editPassengerVisible, setEditPassengerVisible] = useState(false)// 编辑弹框
  const [vipGreetVisible, setVipGreetVisible] = useState(false)// 迎接弹框
  const [farewellOrCancel, setFarewellOrCancel] = useState('')// 送别或者撤销类型
  const [greetAddFlag, handleGreetAddFlag] = useState(false); // 迎接弹框添加随行的显示
  // 页面是否可见
  const inViewPort = useInViewport(() => document.querySelector('#parentBox'));
  // 页面缓存之后，再次打开更新贵宾厅数据
  useActivate(() => {
      getVipRoomDataFun();
  })
  const actionRef = useRef();
  const ref = useRef();

  var code = "";
  var lastTime,nextTime;
  var lastCode,nextCode;
  // 监听扫描枪
  window.onkeypress = function(e) {
      if (!inViewPort[0]) return; //页面不可见，扫码功能不可用
      nextCode = e.which;
      nextTime = new Date().getTime();

      if(lastCode != null && lastTime != null && nextTime - lastTime <= 30) {
          code += String.fromCharCode(lastCode); 
      } else if(lastCode != null && lastTime != null && nextTime - lastTime > 100){
          code = "";
      };

      lastCode = nextCode;
      lastTime = nextTime;
      // 捕获到enter按键的键码， 说明扫码动作完成
      if(e.which == 13){
        if(!logiUserVipId){
          return message.error('请先绑定贵宾室');
        }
        if (code) {
          if (!addEntourageVisible) { //准入管理的添加随行弹框未打开
            if(greetAddFlag){ //迎接弹框的添加随行打开
              setScanCodeToEntourage(code);
            }else{
              setScanCode(code);
            }
            ref.current&&ref.current.setFieldsValue({
              denji: code,
            });
            setOpenType('scan');
            setVipGreetVisible(true);
          }else{
            // 把扫码的结果，传到添加随行弹框
            // setDataSourceFlag('scan');
            setScanCodeToEntourage(code);
          }
          return false;
        }
        code = "";
    }
  }

  // 设置绑定的贵宾室
  useEffect(() => {
    let selectedVipRoom = vipRoomData?.filter((item) => item.id == logiUserVipId);
    setVipRoomObj(selectedVipRoom&&selectedVipRoom[0]);
  }, [vipRoomData,logiUserVipId])

  // 初始化贵宾厅id
  useEffect(() => {
    setLogiUserVipId(localStorage.getItem('userBindRoomId'));
  }, [])
  // 轮询  航班登机保障
  useRequest(vipBoardNotice, {
    pollingInterval: 120000,
    onSuccess: res => {
      res.length > 0 && res.map(item => {
        openNotification(item)
      })
    }
  })
  // 打开登机保障提醒弹框
  const openNotification = (item) => {
    let type = '' // 1 航班取消 2 航班延误 3 登机提醒")
    if (item.noticeType === '1') {
      type = '航班取消'
    } else if (item.noticeType === '2') {
      type = '航班延误'
    } else {
      type = '登机提醒'
    }
    const key = `open${Date.now()}`;
    const btn = (
      <Button type="primary" size="small" onClick={() => notification.close(key)}>
        确定
      </Button>
    );
    notification.open({
      duration: null,
      message: type,
      description:item.noticeContent,
      btn,
      key,
    });
  };


  // 搜索前的回调
  const beforeSearchSubmit = useCallback(params => {
    params['startDate'] = params.startDate ? params.startDate.format('YYYY-MM-DD') : '';
    params['endDate'] = params.endDate ? params.endDate.format('YYYY-MM-DD') : '';
    params['orgCityAirp'] = params.orgCityAirp ? params.orgCityAirp : '';
    if (event.target.querySelector('span') && event.target.querySelector('span').innerText === '重 置') {
      ref.current&&ref.current.setFieldsValue({
        startDate: moment(),
        endDate: moment(),
        orgCityAirp: "CTU"
      });
    }
    setSearchParams(params);
    return params;
  }, []);

  // 刷新表格数据
  const reloadTable = useCallback(function () {
      setScanCode('');
      setScanCodeToEntourage('');
      actionRef?.current?.reload();
      setSelectedRowKeys([]);
      setSelectRow([]);
  }, []);

  // 旅客改签
  // const showEndorse = () => {
  //   setEndorseVisible(true);
  // }
  // 随行人员添加
  const showAddEntourageFun = () => {
    setScanCodeToEntourage('');
    if(!logiUserVipId){
      return message.error('请先绑定贵宾室');
    }
    if (selectRow.length === 0) {
      return message.error('请选中贵宾旅客再添加随行人员')
    }
    if (selectRow.length > 1) {
      return message.error('只能选择一名贵宾旅客手动添加随行人员')
    }
    if (selectRow[0]?.status != 1) {
      return message.error('只有已迎接的旅客才能添加随行人员')
    }
    if (selectRow[0].isAcmp == 1) {
      return message.error('不支持随行人员添加随行')
    }
    confirm({
      title: '提示',
      content: Number(selectRow[0]?.alongs) == 0 ? 
      `贵宾旅客${selectRow[0]?.paxName}，未添加随行人员，是否添加随行人员？`:
      `已为贵宾旅客${selectRow[0]?.paxName}，添加${Number(selectRow[0]?.alongs)}名随行人员${selectRow[0]?.acmpNames}，是否还需添加随行人员？`,
      okText:"是",
      cancelText:"否",
      onOk() {
        setSelectRow([...selectRow])
        setAddEntourageVisible(true);
      },
      onCancel() {},
    });
  }
  // 送别或者撤销
  const showVipFarewellOrCancelFun = (type) => {
    if(!logiUserVipId){
      return message.error('请先绑定贵宾室');
    }
    if (selectRow.length === 0) {
      return message.error(`请选择将要${type === 'farewell' ? '送别' : '撤销'}的旅客`)
    }
    // 判断送别的旅客是否包含 不是已迎接 的旅客
    let nameArr = [];
    // if (type === 'farewell') {
      for (const item of selectRow) {
        if (item.status != 1) {
          nameArr.push(item.paxName);
        }
      }
    // };
    if (nameArr.length !== 0) {
      return message.error(`旅客(${nameArr.join(',')})不是已迎接旅客，不能进行${type === 'farewell' ? '送别' : '撤销'}操作`)
    };
    setFarewellOrCancel(type);
    setFarewellVisible(true);
  }
  // 短信通知
  const showSMSNoticeFun = () => {
    selectRow.length > 0
    ? setSmsNoticeVisible(true)
    : message.error('请至少选择一条记录，然后进行短信通知');
  }
  // 编辑
  const showEditPassengerVisibleFun = () => {
    if(!logiUserVipId){
      return message.error('请先绑定贵宾室');
    }
    if (selectRow.length === 0) {
      return message.error('请选中贵宾旅客再编辑')
    }
    if (selectRow.length > 1) {
      return message.error('只能选择一名贵宾旅客编辑')
    }
    if (selectRow[0].status != 1) {
      return message.error('只能对已迎接的旅客进行编辑')
    }
    setEditPassengerVisible(true);
  }
  // 导出Excel
  const downloadVipEntryPageFun = () => {
    if (!exportFlag) {
      message.error('表格数据为空');
      return false;
    }
    const hide = message.loading('正在导出');
    let downloadParams = JSON.parse(JSON.stringify(searchParams));
    delete downloadParams.current;
    delete downloadParams.pageSize;
    let res = downloadVipEntryPage(downloadParams).then(res => {
        let blob = new Blob([res], {
          type: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
        });
        let elink = document.createElement('a');
        let time = moment(Date.now()).format('YYYY-MM-DD HH_ss_mm');
        elink.download = '贵宾准入管理查询报表' + time + '.xls';
        elink.style.display = 'none';
        elink.href = URL.createObjectURL(blob);
        document.body.appendChild(elink);
        elink.click();
        document.body.removeChild(elink);
        hide();
        message.success('导出成功');
      })
      .catch(err => {});
  };
  // 迎接
  const showVipGreetVisibleFun = () => {
    if(!logiUserVipId){
      return message.error('请先绑定贵宾室');
    };
    setOpenType('click');
    setVipGreetVisible(true);
  }

  // 贵宾分厅选择
  const onChangeVipRoom = (value) => {
    setLogiUserVipId(value);
    roomBindUserFun({vriId:value?value:""});
    // reloadTable();
  }

  // 选中项
  const changeRows = (selectedKeys, selectedRows) => {
    setSelectedRowKeys([...selectedKeys]);
    setSelectRow(selectedRows);
  }

  // 列表项
  const columns = [
    {
      title: 'PNR',
      width: 120,
      dataIndex: 'pnrRef',
      hideInSearch: true
    },
    {
      title: '航班状态',
      dataIndex: 'flightStatus',
      hideInSearch:true,
      width: 90,
      filters: false,
      valueEnum: {
        null: {
          text: '正常',
        },
        'D': {
          text: '延误',
        },
        'C': {
          text: '取消',
        },
        'N': {
          text: '正常',
        },
      },
    },
    {
      title: '航班日期',
      width: 180,
      hideInSearch:true,
      dataIndex: 'lclDptDate',
    },
    {
      title: '航班号',
      width: 90,
      dataIndex: 'flightNo',
      order:10,
      renderFormItem: (_, { defaultRender, ...rest }) => {
        return <Input
          {...rest}
          onChange={e => {
            e.target.value = formatFlightNo(e.target.value);
            rest.onChange(e.target.value)
          }}
          allowClear maxLength={6} placeholder="3U" />;
      }
    },
    {
      title: '机号',
      hideInSearch: true,
      filters: false,
      dataIndex: 'planeCode',
      width: 120,
    },
    {
      title: '起飞时间',
      hideInSearch: true,
      filters: false,
      dataIndex: 'std',
      width: 180,
    },
    {
      title: '登机口',
      filters: false,
      order:7,
      dataIndex: 'gate',
      width: 120,
      renderFormItem: (_, { defaultRender, ...rest }) => {
        return <Input
          {...rest}
          onChange={e => {
            e.target.value= e.target.value.replace(/[^0-9a-zA-Z]/g,'');
            rest.onChange(e.target.value)
          }}
          allowClear maxLength={8} placeholder="请输入" />;
      }
    },
    {
      title: '起始日期',
      width: 90,
      key: 'startDate',
      order:4,
      hideInTable:true,
      renderFormItem: (_, { ...rest }) => {
        const format = 'YYYY-MM-DD';
        return (
          <DatePicker
            style={{ width: '100%' }}
            format={format}
            allowClear
            {...rest}
          />
        );
      },
    },
    {
      title: '结束日期',
      width: 90,
      hideInTable:true,
      key: 'endDate',
      order:3,
      renderFormItem: (_, { ...rest }) => {
        const format = 'YYYY-MM-DD';
        return (
          <DatePicker
            style={{ width: '100%' }}
            format={format}
            allowClear
            {...rest}
          />
        );
      },
    },
    {
      title: '航班登机状态',
      filters: false,
      dataIndex: 'fltBordStatus',
      key:"bordStatus",
      width: 120,
      order:1,
      initialValue: '',
      filters: false,
      valueEnum: {
        '': {
          text: '全部',
        },
        'Y': {
          text: '已开放',
        },
        'N': {
          text: '未开放',
        },
      },
    },
    {
      title: (_, type) => (type === 'table' ? '始发地' : '出发航站'),
      // title: '始发地',
      dataIndex: 'org',
      key: 'orgCityAirp',
      width: 130,
      order: 6,
      renderFormItem: (_, { ...rest }, form) => {
        return (
          <Select
            allowClear={true}
            showSearch
            placeholder='请选择'
            defaultActiveFirstOption={false}
            showArrow={false}
            filterOption={true}
            optionFilterProp="children"
            notFoundContent={null}
            {...rest}
          >
            {
              selectData && selectData.map((v, i) => {
                return (
                  <Option key={v.CITY3CODE} value={v.CITY3CODE}>{v.CITYNAME}-{v.CITY3CODE}</Option>
                )
              })
            }
          </Select>
        );
      }
    },
    // 到达
    {
      title: (_, type) => (type === 'table' ? '目的地' : '到达航站'),
      // title: '目的地',
      dataIndex: 'dst',
      key: 'dstCityAirp',
      order: 5,
      width: 100,
      renderFormItem: (_, { ...rest }, form) => {
        return (
          <Select
            allowClear={true}
            showSearch
            placeholder='请选择'
            defaultActiveFirstOption={false}
            showArrow={false}
            filterOption={true}
            optionFilterProp="children"
            notFoundContent={null}
            {...rest}
          >
            {
              selectData && selectData.map((v, i) => {
                return (
                  <Option key={v.CITY3CODE} value={v.CITY3CODE}>{v.CITYNAME}-{v.CITY3CODE}</Option>
                )
              })
            }
          </Select>
        );
      }
    },
    {
      title: '航线',
      hideInSearch: true,
      dataIndex: 'fltRoute',
      width: 130
    },
    {
      title: '旅客姓名',
      dataIndex: 'paxName',
      order:9,
      width: 130
    },
    {
      title: '登机牌条码',
      dataIndex: 'denji',
      order:8,
      hideInTable:true,
      width: 130,
      renderFormItem: (_, { defaultRender, ...rest }) => {
        return <Input 
          {...rest} 
          allowClear placeholder="请输入" />;
      }
    },
    {
      title: '随行人数',
      hideInSearch: true,
      dataIndex: 'alongs',
      width: 130
    },
    {
      title: '旅客类型',
      ellipsis: true,
      hideInSearch: true,
      dataIndex: 'paxTypeDesc',
      width: 180,
      render:(_) => {
        return <div style={{height:"6px"}} >{_}</div>
      },
    },
    {
      title: '联系电话',
      ellipsis: true,
      hideInSearch: true,
      dataIndex: 'phoneNum',
      width: 130,
      render:(_) => {
        return <div style={{height:"6px"}} >{_}</div>
      },
    },
    {
      title: '子舱位',
      hideInSearch: true,
      dataIndex: 'subClass',
      width: 130
    },
    {
      title: '旅客状态',
      dataIndex: 'status',
      key: 'status',
      width: 100,
      order:2,
      initialValue: '',
      filters: false,
      valueEnum: {
        '': {
          text: '全部',
        },
        '1': {
          text: '已迎接',
        },
        '2': {
          text: '已送别',
        },
        '3': {
          text: '已拒绝',
        },
        // '4': {
        //   text: '未迎接',
        // },
      },
    },
    {
      title: '进入时间',
      dataIndex: 'entryTime',
      hideInSearch: true,
      width: 180
    },
    {
      title: '离开时间',
      hideInSearch: true,
      dataIndex: 'leaveTime',
      width: 180
    },
    {
      title: '贵宾室',
      hideInSearch: true,
      dataIndex: 'roomName',
      width: 100
    },
    {
      title: '备注信息',
      ellipsis: true,
      hideInSearch: true,
      dataIndex: 'memo',
      width: 180,
      render:(_) => {
        return <div style={{height:"6px"}} >{_}</div>
      },
    }
    ,
    {
      title: '操作人员',
      hideInSearch: true,
      dataIndex: 'empId',
      width: 100
    }
  ];
  return (
    <div id="parentBox">
      <ProTable
        options={{ density: false, fullScreen: true, reload:false, setting: true }}
        size='small'
        formRef={ref}
        scroll={{ x: 1000, y: controlTableHeight(isCollapse, 360, 470) }}
        className={styles.vipAccessTable}
        headerTitle={
          <div>
            <span style={{ paddingRight: 10, fontWeight: "bold", color: "#000" }}>准入贵宾列表</span>
            <div className={styles.toolbaropt}>
              贵宾分厅：
              <Select
                showSearch
                style={{ width: 200 }}
                allowClear
                placeholder="请选择贵宾分厅"
                optionFilterProp="children"
                onChange={onChangeVipRoom}
                value={logiUserVipId}
              >
                {
                  vipRoomData?.map((v) => {
                    return (
                      <Option key={v.id} value={v.id+''}>{v.roomName}</Option>
                    )
                  })
                }
              </Select>
              <span style={{ margin: "0 10px 0 20px" }}> 已迎接： <span>{meetPeoples || 0}</span> 人</span>
              <span> 已送别：<span>{farewellPeoples || 0}</span> 人</span>
            </div>
          </div>
        }
        toolBarRender={() => [
          // <Button onClick={showEndorse}>
          //   旅客改签
          // </Button>,
          <AuthComponent authCode="vip.vipAccess.SMS">
            <Button onClick={showSMSNoticeFun}>
              短信通知
            </Button>
          </AuthComponent>,
          <AuthComponent authCode="vip.vipAccess.addEntourage">
            <Button onClick={showAddEntourageFun}>
              随行人员添加
            </Button>
          </AuthComponent>,
          <AuthComponent authCode="vip.vipAccess.farewell">
            <Button onClick={() => showVipFarewellOrCancelFun('farewell')}>
              送别
            </Button>
          </AuthComponent>,
          <AuthComponent authCode="vip.vipAccess.edit">
            <Button onClick={showEditPassengerVisibleFun}>
              编辑
            </Button>
          </AuthComponent>,
          <AuthComponent authCode="vip.vipAccess.download">
            <Button onClick={downloadVipEntryPageFun}>
              下载
            </Button>
          </AuthComponent>,
          <AuthComponent authCode="vip.vipAccess.cancel">
            <Button onClick={() => showVipFarewellOrCancelFun('cancel')}>
              撤销
            </Button>
          </AuthComponent>,
          <AuthComponent authCode="vip.vipAccess.greet">
            <Button type="primary" onClick={showVipGreetVisibleFun}>
              迎接
            </Button>
          </AuthComponent>,
        ]}
        search={{
          onCollapse: val => {
            controlC(val);
          },
          span: { //设置排列方式
            xs: 24,
            sm: 24,
            md: 6,
            lg: 6,
            xl: 6,
            xxl: 6,
        }
        }}
        actionRef={actionRef}
        formRef={ref}
        dateFormatter="YYYY-MM-DD"
        pagination={{
          showSizeChanger: true,
          showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 项`,
          total:dataTotal
        }}
        rowKey="id"
        beforeSearchSubmit={beforeSearchSubmit}
        rowClassName={record => {
          if (record.isAcmp == 1) return styles.tableColorDust;
        }}
        request={params => {
          if (!('startDate' in params)) {
            params['startDate'] = moment().format('YYYY-MM-DD');
            ref.current&&ref.current.setFieldsValue({
              startDate: moment(),
            })
          }
          if (!('endDate' in params)) {
            params['endDate'] = moment().format('YYYY-MM-DD');
            ref.current&&ref.current.setFieldsValue({
              endDate: moment()
            })
          }
          if (!params['status']) {
             ref.current&&ref.current.setFieldsValue({
              status: '',
            })
          }
          if (!params['bordStatus']) {
              ref.current&&ref.current.setFieldsValue({
                bordStatus: '',
            })
          }
          if (!('orgCityAirp' in params)) {
            params['orgCityAirp'] = "CTU"
            ref.current && ref.current.setFieldsValue({
              orgCityAirp: "CTU",
            });
          }
          setSearchParams({ ...params, vipRoomId: logiUserVipId === 'null' ? null : logiUserVipId  });
          return getlistVIPEntryPage({ ...params, vipRoomId: logiUserVipId === 'null' ? null : logiUserVipId });
        }}
        postData={data => {
          setLogiUserVipId(data?.vipRoomId);
          localStorage.setItem('userBindRoomId', data?.vipRoomId);
          setMeetPeoples(data?.enrtyPeopleNums);
          setFarewellPeoples(data?.leavePeopleNums);
          
          let resData = data?.vipEntryIPage?.data
          handleExportFlag(resData.length === 0 ? false : true);
          // for (let index = 0; index < resData?.length; index++) {
          //   resData[index].keyFlag = index;
          // }
          setDataTotal(data?.vipEntryIPage?.total)
          return resData;
        }}
        columns={columns}
        rowSelection={{ selectedRowKeys,onChange: changeRows }}
        tableAlertRender={false}//选中提示
      />

      {/* 页面自定义组件 start*/}
      {/* 改签 */}
      {/* <Endorse {...{
        endorseVisible, 
        setEndorseVisible
      }} /> */}
      {/* 添加随行人员 */}
      <AddEntourage {...{ 
        addEntourageVisible, 
        setAddEntourageVisible, 
        addOrGreet:"add",
        selectData,
        addEntourageSelectRow: selectRow,
        reloadTable,
        checkedAlongs:[],
        scanCodeToEntourage:addEntourageVisible ? scanCodeToEntourage : undefined,
        // dataSourceFlag
      }} />

      {/* 送别 或 撤销*/}
      <VipFarewellOrCancel {...{ 
        farewellOrCancel, 
        farewellVisible, 
        setFarewellVisible, 
        selectRow,
        reloadTable
      }} />

      {/* 短信通知 */}
      <SMSNotice {...{ 
        smsNoticeVisible, 
        setSmsNoticeVisible,
        rowData: selectRow
      }} />
      
      {/* 编辑 */}
      <EditPassenger {...{ 
        editPassengerVisible,
        setEditPassengerVisible,
        selectRow,
        vipRoomObj,
        reloadTable,
        paxTypeData
      }} />

      {/* 迎接 */}
      <VipGreet {...{ 
        vipGreetVisible, 
        setVipGreetVisible,
        scanCode,
        setScanCode,
        openType,
        selectData,
        vipRoomObj,
        reloadTable,
        paxTypeData,
        scanCodeToEntourage:addEntourageVisible ? undefined : scanCodeToEntourage,
        selectRow:[],
        handleGreetAddFlag
      }} />


      {/* 页面自定义组件 end*/}
    </div>
  );
};

export default Form.create()(VipAccess);